package com.example.dmdomain;

import com.example.dmdomain.entity.ProvinceCity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface ProvinceRepository extends JpaRepository<ProvinceCity, String>, JpaSpecificationExecutor<ProvinceCity> {

	@Query(value = "select province from province_city where city = :city", nativeQuery = true)
	String findProvinceByCity(@Param("city") String city);

}
